@extends('layouts.frontend-iframe-base')

@section('css')
    <link href="/dist/frontend/css/bootstrap.min.css" rel="stylesheet">
    <link href="/dist/frontend/css/work.css" rel="stylesheet">
@stop
@section('content')
    @if($finalResults)
        @foreach($finalResults as $k=>$finalRes)
    <div class="container-box">
        <div class="row-border">
            <h3 class="my-title">基站: {{$k}}</h3>
            <!-- 电路图1 -->
            @if($finalRes)
              @foreach($finalRes as $g=>$group)
            <div class="row" >
                @if($group)
                    @foreach($group[0] as $device)
                    <div class="col-md-1 col-sm-1 col-xs-1">
                        <div class="text-box"style="width:30px;" >
                            <span class="img-border"><img src="/dist/frontend/images/gf.png"></span>
                            <span class="my-x h-40"></span>
                            <div class="my-pic" style=" text-align:center;">
                                @if($device['working'] == 1)
                                <img class="canvast" src="/dist/frontend/images/ls.png"  class = "canvast" width = '10px' height = '10px'>
                                @else
                                <img class="canvast" src="/dist/frontend/images/hs.png"  class = "canvast" width = '10px' height = '10px'>
                                @endif
                                <span class="img-border-n"></span>
                                <span class="my-x h-20"></span>
                                <input  style="display:none"value="{{$device['device_id']}}">
                                <span class="my-name">{{$device['name']}}</span>
                            </div>
                            <span class="info-text" >
                                <ul>
                                    <li>状态：@if($device['working'] == 1)正常 @else 异常 @endif</li>
                                    <li class="j-tody-fa">今日发电量：kwh</li>
                                    <li class="j-wendu">温度:℃</li>
                                </ul>
                                  <em></em>
                            </span>
                        </div>
                    </div>

                    @endforeach
                @endif
                <!-- /.col -->
                    <div class = "canvaz" ></div>
                <h4>{{$g}}</h4>
            </div>
            @endforeach
            @endif
        </div>
    </div>
        @endforeach
    @endif
@stop

@section('js')
<script src="/dist/frontend/js/jquery-2.1.4.min.js"></script>
<script>
    $(function(){
        $('.text-box').hover(function(){
            var device_id=$(this).find('input').val();
            $.get('/frontend/device/status?device_id='+device_id,function(data){
                if(data.status ==1)
                {
                    $('.j-tody-fa').text('今日发电量:'+data.data.GenCap+'kwh');
                    $('.j-wendu').text('温度:'+data.data.temp+'℃');

                }

            });
        },function(){
            $('.info-text').stop();
        })
    })
</script>

@stop